<template>
    <div id="app">
        <router-view />
    </div>
</template>
<style src="@wangeditor/editor/dist/css/style.css"></style>

<style lang="scss">
.editor {
    z-index: 999999;
    width: 100%;
    min-height: 500px;
    border: 1px solid #8d8d8d;
}

#app {
    background-color: rgba(250, 248, 248, 0.98);
}

html {
    margin: 0;
    padding: 0;
}

body {}

* {
    //box-sizing: border-box;
}
</style>

<script>
export default {
    name: "home",
    methods: {
        showUpdateTips() {
            this.$notification['warning']({
                message: '更新提示',
                description: '系统版本已更新，点击按钮刷新页面',
                btn: h => h('a-button', {
                    props: { type: 'primary', size: 'small', },
                    on: { click: () => location.reload() },
                }, '更新')
            });
        },
        async getVersion() {
            console.log('v:' + process.env.version)
            document.getElementById('app').dataset.version = process.env.version
            // 获取最新的版本号 如果版本过低 提示刷新
            // const res = await getVersion({ skipCount: 0, maxResultCount: 1 })
            // if (res.items && res.items[0]) {
            //     console.info(process.env)
            //     const firstVersion = res.items[0].version
            //     const versionStr = firstVersion.split('-')[1]
            //     if (process.env && process.env.version) {
            //         document.getElementById('app').dataset.version = process.env.version
            //         if (versionStr && versionStr > process.env.version) {
            //             this.showUpdateTips()
            //         }
            //     }
            // }
        }
    },
    mounted() {
        this.getVersion()
    }

}

</script>
